// app.js
const updateManager = wx.getUpdateManager()

updateManager.onCheckForUpdate(res => {
  // 请求完新版本信息的回调
  //console.log(res.hasUpdate)
})

updateManager.onUpdateReady(() => {
  wx.showModal({
    title: '更新提示',
    content: '新版本已经准备好，是否重启应用？',
    success(res) {
      if (res.confirm) {
        // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
        updateManager.applyUpdate()
      }
    }
  })
})
App({
  serverUrl: 'https://ty.xafsyweb.club/zaomeng-api/api/',
  appid: 'wxa3b7a228386aece3',
  publicNo: 'gh_4f86dcaf1d9a',
  applicationID: '8a2f462a66cac9130166ccd9c99304f4',
  goodsobjectDefineID: '422429993732', //商品的定义ID
  articleobjectDefineID: '422429993731', //文章对象定义id
  siteID: '8a2f462a66cac9130166ccd9cc570502', //站点id
  companyID: '8a2f462a66cac9130166ccd7c22b04e9', //公司id
  shopID: '34234243', //店铺id
  categoryID: 'c82678b8ea0149c18fe6ac5ac8590d73', //分类顶级id
  wxPaywayID: '402892e96a4ed7a4016a4eda9107000c', //微信支付
  balacnePaywayID: '000000007ff9ef5601800c6b37ae0020', //余额支付
  monthPaywayID: '000000008011fce301801cf9f4970011', //月结支付
  focusID: '8b4691c368674107ad315e75b2a57ec2', //轮播id
  men: '23ec6505d9d742f0bdd0046dfd64b92c', //女士
  man: 'b3d9feef6c5c485fa1d089503f034952', //先生
  searchDefineID: '00000000703d8ed90170e66061f80066', //店铺搜索热词ID
  hotNavId: '1be1c73e64f14e659cc20125a387df92', //首页hot栏
  hotRecommandNavId: 'b70f212f31d74dc391bbe06f5dd8ec7f', //新品上市
  zhaopaiId: 'a463fc156f9841878c4d485ecdc7e5f8',//招牌系列
  zhuchuTjId: '5e794c186ee94174bf8c78f038036c34',//主厨推荐
  tianpinZyId: 'de4717f07dfd4823863ce0b10ab4500a',//甜品自由
  defaultShareTitle: '玉门羊火炉', //分享默认标题
  defaultQrcodeUrl: 'pages/index/index', //自定义二维码url
  defaultShareUrl: '/pages/index/index', //分享默认url
  logoUrl: '/img/logo.png', //默认logo
  aboutUsArticleID: '00000000703d8ed90170e701ea750088', //关于我们文章id
  cityRootId: '0', //中国id
  companyAggrementArticleId: '00000000703d8ed90170e7023ee7008b', //公司证书文章
  companyWinArticleId: '00000000703d8ed90170e702a365008e', //公司荣誉文章
  pointArticleID: '0000000070eb656a0170ed0608ac001a',//积分规则文章
  orderAmountFreeFare: 'orderAmountFreeFare',//订单满多少免运费
  orderFare: 'orderFare',//订单运费
  point2Price: 'point2Price',//100积分抵扣金额
  onLaunch(e) {
    const that = this;
    wx.getSystemInfo({
      success: function (res) {
        that.globalData.bottomHeight=res.screenHeight-res.safeArea.bottom
      }
    })
  },
  globalData: {
    userInfo: null,
    bottomHeight: 0,
    keywords: '',
  }
})